home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
boostrs.arc
/
XTIMEXY.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1985-11-16
|
918b
|
49 lines
{$IBoDecl}
{$IPutStr}
{$ITimeXY}
{$IStime}
var
hh,mm,ss : integer;
function Range ( Ch: Char): boolean;
begin
case Ch of
#32,#48..#57 : Range := True
else
Range := false;
end;
end;
BEGIN
ClrScr;
S := '';
PutStr ( h,'Current time: ',30,1, 14 );
PutStr ( h, 'Enter new time exactly as shown',1, 9, 14);
PutStr ( h, ' HH MM SS: ',1,10, 14);
SaveX := 17;
SaveY := 10;
Repeat
repeat
TimeXY(44,1);
GoToXY(SaveX,SaveY);
until KeyPressed;
read(Kbd,ch);
if Range(ch) then
begin
S := S + ch;
write(Ch);
SaveX := WhereX;
end;
until Ch = #13;
val ( Copy(S,1,2),hh,ecode );
val ( Copy(S,4,2),mm,ecode );
val ( Copy(S,7,2),ss,ecode );
Stime ( hh,mm,ss );
GotoXY(44,1);
ClrEol;
repeat TimeXY(44,1) until KeyPressed;
END.